
AddWeaponTo={

	_value=_this select 0;
	(str value+" ADDWEAPON") call debug;
	
	if(!isNil "_value")then{
	
		format["weapon = %1",_value] call debug;
		testWP addWeaponCargo [((WeaponList select _value) select 1),1];
		testWP addMagazineCargo [((WeaponList select _value) select 2),((WeaponList select _value) select 3)];
	
	};
	
	TankAddWeapon=nil;
	publicVariable "TankAddWeapon";
	
}; 

AddAmmoTo={

	_value=_this select 0;
	(str value+" ADDAMMO") call debug;
	
	if(!isNil "_value")then{
	
		format["AMMO = %1",(AmmoList select _value)] call debug;
		testWP addMagazineCargo [(AmmoList select _value),10];
	};
	
	TankAddAmmo=nil;
	publicVariable "TankAddAmmo";
	
}; 

"TankAddWeapon" addPublicVariableEventHandler {[_this select 1] call AddWeaponTo};
"TankAddAmmo" addPublicVariableEventHandler {[_this select 1] call AddAmmoTo};


